package com.mvis.grpc.lib;

import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;

/**
 */
@javax.annotation.Generated(
    value = "by gRPC proto compiler (version 1.25.0)",
    comments = "Source: vno.proto")
public final class VnoServiceGrpc {

  private VnoServiceGrpc() {}

  public static final String SERVICE_NAME = "vno.VnoService";

  // Static method descriptors that strictly reflect the proto.
  private static volatile io.grpc.MethodDescriptor<com.mvis.grpc.lib.VnoProto.VnoRequest,
      com.mvis.grpc.lib.VnoProto.VnoReply> getRunMethod;

  @io.grpc.stub.annotations.RpcMethod(
      fullMethodName = SERVICE_NAME + '/' + "Run",
      requestType = com.mvis.grpc.lib.VnoProto.VnoRequest.class,
      responseType = com.mvis.grpc.lib.VnoProto.VnoReply.class,
      methodType = io.grpc.MethodDescriptor.MethodType.UNARY)
  public static io.grpc.MethodDescriptor<com.mvis.grpc.lib.VnoProto.VnoRequest,
      com.mvis.grpc.lib.VnoProto.VnoReply> getRunMethod() {
    io.grpc.MethodDescriptor<com.mvis.grpc.lib.VnoProto.VnoRequest, com.mvis.grpc.lib.VnoProto.VnoReply> getRunMethod;
    if ((getRunMethod = VnoServiceGrpc.getRunMethod) == null) {
      synchronized (VnoServiceGrpc.class) {
        if ((getRunMethod = VnoServiceGrpc.getRunMethod) == null) {
          VnoServiceGrpc.getRunMethod = getRunMethod =
              io.grpc.MethodDescriptor.<com.mvis.grpc.lib.VnoProto.VnoRequest, com.mvis.grpc.lib.VnoProto.VnoReply>newBuilder()
              .setType(io.grpc.MethodDescriptor.MethodType.UNARY)
              .setFullMethodName(generateFullMethodName(SERVICE_NAME, "Run"))
              .setSampledToLocalTracing(true)
              .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.mvis.grpc.lib.VnoProto.VnoRequest.getDefaultInstance()))
              .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller(
                  com.mvis.grpc.lib.VnoProto.VnoReply.getDefaultInstance()))
              .setSchemaDescriptor(new VnoServiceMethodDescriptorSupplier("Run"))
              .build();
        }
      }
    }
    return getRunMethod;
  }

  /**
   * Creates a new async stub that supports all call types for the service
   */
  public static VnoServiceStub newStub(io.grpc.Channel channel) {
    return new VnoServiceStub(channel);
  }

  /**
   * Creates a new blocking-style stub that supports unary and streaming output calls on the service
   */
  public static VnoServiceBlockingStub newBlockingStub(
      io.grpc.Channel channel) {
    return new VnoServiceBlockingStub(channel);
  }

  /**
   * Creates a new ListenableFuture-style stub that supports unary calls on the service
   */
  public static VnoServiceFutureStub newFutureStub(
      io.grpc.Channel channel) {
    return new VnoServiceFutureStub(channel);
  }

  /**
   */
  public static abstract class VnoServiceImplBase implements io.grpc.BindableService {

    /**
     */
    public void run(com.mvis.grpc.lib.VnoProto.VnoRequest request,
        io.grpc.stub.StreamObserver<com.mvis.grpc.lib.VnoProto.VnoReply> responseObserver) {
      asyncUnimplementedUnaryCall(getRunMethod(), responseObserver);
    }

    @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() {
      return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
          .addMethod(
            getRunMethod(),
            asyncUnaryCall(
              new MethodHandlers<
                com.mvis.grpc.lib.VnoProto.VnoRequest,
                com.mvis.grpc.lib.VnoProto.VnoReply>(
                  this, METHODID_RUN)))
          .build();
    }
  }

  /**
   */
  public static final class VnoServiceStub extends io.grpc.stub.AbstractStub<VnoServiceStub> {
    private VnoServiceStub(io.grpc.Channel channel) {
      super(channel);
    }

    private VnoServiceStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected VnoServiceStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new VnoServiceStub(channel, callOptions);
    }

    /**
     */
    public void run(com.mvis.grpc.lib.VnoProto.VnoRequest request,
        io.grpc.stub.StreamObserver<com.mvis.grpc.lib.VnoProto.VnoReply> responseObserver) {
      asyncUnaryCall(
          getChannel().newCall(getRunMethod(), getCallOptions()), request, responseObserver);
    }
  }

  /**
   */
  public static final class VnoServiceBlockingStub extends io.grpc.stub.AbstractStub<VnoServiceBlockingStub> {
    private VnoServiceBlockingStub(io.grpc.Channel channel) {
      super(channel);
    }

    private VnoServiceBlockingStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected VnoServiceBlockingStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new VnoServiceBlockingStub(channel, callOptions);
    }

    /**
     */
    public com.mvis.grpc.lib.VnoProto.VnoReply run(com.mvis.grpc.lib.VnoProto.VnoRequest request) {
      return blockingUnaryCall(
          getChannel(), getRunMethod(), getCallOptions(), request);
    }
  }

  /**
   */
  public static final class VnoServiceFutureStub extends io.grpc.stub.AbstractStub<VnoServiceFutureStub> {
    private VnoServiceFutureStub(io.grpc.Channel channel) {
      super(channel);
    }

    private VnoServiceFutureStub(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      super(channel, callOptions);
    }

    @java.lang.Override
    protected VnoServiceFutureStub build(io.grpc.Channel channel,
        io.grpc.CallOptions callOptions) {
      return new VnoServiceFutureStub(channel, callOptions);
    }

    /**
     */
    public com.google.common.util.concurrent.ListenableFuture<com.mvis.grpc.lib.VnoProto.VnoReply> run(
        com.mvis.grpc.lib.VnoProto.VnoRequest request) {
      return futureUnaryCall(
          getChannel().newCall(getRunMethod(), getCallOptions()), request);
    }
  }

  private static final int METHODID_RUN = 0;

  private static final class MethodHandlers<Req, Resp> implements
      io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
      io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
    private final VnoServiceImplBase serviceImpl;
    private final int methodId;

    MethodHandlers(VnoServiceImplBase serviceImpl, int methodId) {
      this.serviceImpl = serviceImpl;
      this.methodId = methodId;
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        case METHODID_RUN:
          serviceImpl.run((com.mvis.grpc.lib.VnoProto.VnoRequest) request,
              (io.grpc.stub.StreamObserver<com.mvis.grpc.lib.VnoProto.VnoReply>) responseObserver);
          break;
        default:
          throw new AssertionError();
      }
    }

    @java.lang.Override
    @java.lang.SuppressWarnings("unchecked")
    public io.grpc.stub.StreamObserver<Req> invoke(
        io.grpc.stub.StreamObserver<Resp> responseObserver) {
      switch (methodId) {
        default:
          throw new AssertionError();
      }
    }
  }

  private static abstract class VnoServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier {
    VnoServiceBaseDescriptorSupplier() {}

    @java.lang.Override
    public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() {
      return com.mvis.grpc.lib.VnoProto.getDescriptor();
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() {
      return getFileDescriptor().findServiceByName("VnoService");
    }
  }

  private static final class VnoServiceFileDescriptorSupplier
      extends VnoServiceBaseDescriptorSupplier {
    VnoServiceFileDescriptorSupplier() {}
  }

  private static final class VnoServiceMethodDescriptorSupplier
      extends VnoServiceBaseDescriptorSupplier
      implements io.grpc.protobuf.ProtoMethodDescriptorSupplier {
    private final String methodName;

    VnoServiceMethodDescriptorSupplier(String methodName) {
      this.methodName = methodName;
    }

    @java.lang.Override
    public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() {
      return getServiceDescriptor().findMethodByName(methodName);
    }
  }

  private static volatile io.grpc.ServiceDescriptor serviceDescriptor;

  public static io.grpc.ServiceDescriptor getServiceDescriptor() {
    io.grpc.ServiceDescriptor result = serviceDescriptor;
    if (result == null) {
      synchronized (VnoServiceGrpc.class) {
        result = serviceDescriptor;
        if (result == null) {
          serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME)
              .setSchemaDescriptor(new VnoServiceFileDescriptorSupplier())
              .addMethod(getRunMethod())
              .build();
        }
      }
    }
    return result;
  }
}
